; The Assignment main menu start1: pload ehass 1 putup 0 415 p1 pfree 1 pload asstp 1 putup 111 79 p1 pfree 1 pload ebass 1 putup 8 31 p1 pfree 1 pload ebnav 1 putup 0 0 p1 pfree 1 menu11: set gonum 11 mn11: waitkey getkey k if @k==1 set num 1 goto menu111 else if @k==2 set num 1 goto menu112 else if @k==3 set num 1 xbkg goto menu113 else if @k==4 set num 1 goto menu114 else if @k==5 goto menu115 else if @k==chr(104)||@k==chr(72) set hnum 1 goto help else if @k==chr(112)||@k==chr(80) xbkg2 link eagle menu1 else if @k==chr(101)||@k==chr(69) xbkg pload edexit 1 putup 190 200 p1 pfree 1 mn11b: waitkey getkey k if @k==chr(13) exit else if @k==chr(27) xbkg pload asstp 1 putup 111 79 p1 pfree 1 goto menu11 else goto mn11b endif endif else goto mn11 endif endif endif endif endif endif endif endif ; Audio Introduction selection display menu111: set gonum 111 set num 1 set abort on mn111: set k "" set m "" pload menum 1 pfade 0 1 pfree 1 pload aix$@num 1 set px (639-p1->xsize)/2 set py 67+((355-p1->ysize)/2) putup @px @py p1 pfree 1 if @num==1 cdplay 2 21 timer waitkey 2100 endif if @num==2 cdplay 3 28 timer waitkey 2800 endif if @num==3 cdplay 4 16 timer waitkey 1600 endif if @num==4 cdplay 5 20 timer waitkey 2000 endif if @num==5 cdplay 6 9 timer waitkey 900 endif getkey m xstop cdstop if @num==5 pload ebkg 1 pfade 0 1 pfree 1 set abort off goto start1 else set num @num+1 goto mn111 endif ; Rosenblatt Audio with photos selection display menu112: set gonum 112 set abort on mn112: set k "" set m "" pload menum 1 pfade 0 1 pfree 1 pload arx$@num 1 set px (639-p1->xsize)/2 set py 67+((355-p1->ysize)/2) putup @px @py p1 pfree 1 if @num==1 cdplay 59 21 timer waitkey 2100 endif if @num==2 cdplay 60 21 timer waitkey 2100 endif if @num==3 cdplay 61 21 timer waitkey 2100 endif if @num==4 cdplay 62 15 timer waitkey 1500 endif if @num==5 cdplay 63 9 timer waitkey 900 endif if @num==6 cdplay 64 14 timer waitkey 1400 endif if @num==7 cdplay 65 20 timer waitkey 2000 endif if @num==8 cdplay 66 25 timer waitkey 2500 endif if @num==9 cdplay 67 65 timer waitkey 6500 endif getkey m xstop cdstop if @num==9 pload ebkg 1 pfade 0 1 pfree 1 goto start1 else set num @num+1 goto mn112 endif ; Rosenblatt text selection display menu113: set gonum 113 mn113: color 0 rect 40 95 600 405 color 1 fload times15 1 fgaps 1 5 3 set buf readfile(artxt$@num$.doc) window 60 95 580 390 text @@buf . farfree(@buf) window set center on ffree 1 fload ibm8 1 text 0 115 "Page "$@num$" of 19" text 0 105 "Press for next or for prior." set center off ffree 1 mn113b: waitkey getkey k if @k==1 set num 1 goto menu111 else if @k==2 set num 1 goto menu112 else if @k==4 set num 1 goto menu114 else if @k==5 goto menu115 else if @k==chr(104)||@k==chr(72) set hnum 1 goto help else if @k==chr(112)||@k==chr(80) xbkg2 link eagle menu1 else if @k==chr(101)||@k==chr(69) xbkg pload edexit 1 putup 190 200 p1 pfree 1 mn113c: waitkey getkey k if @k==chr(13) exit else if @k==chr(27) xbkg goto mn113 else goto mn113c endif endif else if @k==chr(73)$chr(1)||@k==chr(72)$chr(1) if @num==19 set num 1 goto mn113 else set num @num+1 goto mn113 endif else if @k==chr(81)$chr(1)||@k==chr(80)$chr(1) if @num==1 set num 19 goto mn113 else set num @num-1 goto mn113 endif else goto mn113b endif endif endif endif endif endif endif endif endif ; PF Vision/Tech Info (Photos w/Captions) selection display menu114: set gonum 114 xbkg mn114: pload ebcft 1 putup 16 74 p1 pfree 1 pload apx$@num 1 putup 32 140 p1 pfree 1 color 1 fload ibm8 1 fgaps 1 4 2 set buf readfile(apx$@num$.doc) window 408 125 592 375 text @@buf . farfree(@buf) window ffree 1 mn114b: waitkey getkey k if @k==1 set num 1 goto menu111 else if @k==2 set num 1 goto menu112 else if @k==3 set num 1 xbkg goto menu113 else if @k==5 goto menu115 else if @k==chr(104)||@k==chr(72) set hnum 1 goto help else if @k==chr(112)||@k==chr(80) xbkg2 link eagle menu1 else if @k==chr(101)||@k==chr(69) xbkg pload edexit 1 putup 190 200 p1 pfree 1 mn114c: waitkey getkey k if @k==chr(13) exit else if @k==chr(27) goto mn114 else goto mn114c endif endif else if @k==chr(13) if @num==8 xbkg pload asstp 1 putup 111 79 p1 pfree 1 goto menu11 else set num @num+1 goto mn114 endif else goto mn114b endif endif endif endif endif endif endif endif ; On Location (Video) selection display menu115: set gonum 115 set k "" set abort on mn115: pload ebkg 1 pfade 0 1 pfree 1 pload assolv 1 palette 1 putup 120 152 p1 pfree 1 mn115b: color 0 rect 147 212 306 331 waitkey getkey k if @k==chr(109)||@k==chr(77) pload ebkg 1 palette 1 pfade 0 1 pfree 1 set abort off goto start1 else if @k==1 pload assolv1 putup 120 152 p1 pfree 1 set num 1 mn1156: set k "" set m "" color 0 rect 147 212 306 331 pload avxa$@num 1 putup 147 211 p1 pfree 1 if @num==1 cdplay 39 12 timer waitkey 1200 endif if @num==2 cdplay 40 12 timer waitkey 1200 endif if @num==3 cdplay 41 16 timer waitkey 1600 endif if @num==4 cdplay 42 15 timer waitkey 1500 endif if @num==5 cdplay 43 17 timer waitkey 1700 endif getkey m xstop1 cdstop if @num==5 pload assolv 1 putup 120 152 p1 pfree 1 goto mn115b else set num @num+1 goto mn1156 endif else if @k==2 pload assolv1 putup 120 152 p1 pfree 1 set num 1 set snum 1 set abort on mn1157: set k "" set m "" color 0 rect 147 212 306 331 pload avxb$@num 1 putup 147 211 p1 pfree 1 if @num==1 cdplay 44 16 timer waitkey 1600 endif if @num==2 cdplay 45 14 timer waitkey 1400 endif if @num==3 cdplay 46 13 timer waitkey 1300 endif if @num==4 cdplay 47 13 timer waitkey 1300 endif getkey m xstop1 cdstop if @num==4 pload assolv 1 putup 120 152 p1 pfree 1 goto mn115b else set num @num+1 goto mn1157 endif else if @k==3 pload assolv1 putup 120 152 p1 pfree 1 set num 1 set abort on mn1158: set k "" set m "" color 0 rect 147 212 306 331 pload avxc$@num 1 putup 147 211 p1 pfree 1 if @num==1 cdplay 48 18 timer waitkey 1800 endif if @num==2 cdplay 49 12 timer waitkey 1200 endif getkey m xstop1 cdstop if @num==2 pload assolv 1 putup 120 152 p1 pfree 1 goto mn115b else set num @num+1 goto mn1158 endif else goto mn115b endif endif endif endif help: pload apatch 1 putup 0 0 p1 pfree 1 pload eclbb 1 putup 0 29 p1 pfree 1 xbkg pload edhelp 1 putup 31 74 p1 pfree 1 hlp1: color 0 rect 60 355 580 140 fload ibm8 1 fgaps 1 4 2 set buf readfile(assihlp$@hnum$.doc) window 65 345 575 100 color 1 text @@buf . farfree(@buf) window set center on text 0 150 "Page "$@hnum$" of 2" text 0 140 "Press for next or for prior." set center off ffree 1 hlp2: waitkey getkey k if @k==chr(13) if @gonum==11 xbkg pload asstp 1 putup 111 79 p1 pfree 1 pload ebass 1 putup 8 31 p1 pfree 1 pload ebnav 1 putup 0 0 p1 pfree 1 goto menu11 else xbkg pload ebass 1 putup 8 31 p1 pfree 1 pload ebnav 1 putup 0 0 p1 pfree 1 goto menu$@gonum endif else if @k==chr(73)$chr(1)||@k==chr(72)$chr(1) if @hnum==2 set hnum 1 goto hlp1 else set hnum @hnum+1 goto hlp1 endif else if @k==chr(81)$chr(1)||@k==chr(80)$chr(1) if @hnum==1 set hnum 2 goto hlp1 else set hnum @hnum-1 goto hlp1 endif else goto hlp2 endif endif endif xbkg: pload ebkgx 1 putup 0 67 p1 pfree 1 return xbkg2: pload eclbb 1 putup 0 29 p1 pfree 1 pload ebkgx 1 putup 0 67 p1 pfree 1 pload eclhx 1 putup 0 412 p1 pfree 1 return xStop: if len(@m) cdstop pload ebkg 1 palette 1 pfade 0 1 pfree 1 set abort off pop start1 else return endif xStop1: if len(@m) cdstop color 0 rect 147 212 306 331 pload ebkg 1 palette 1 pfade 0 1 pfree 1 set abort off pop start1 else return endif ; ; CDINIT ; ; Check for CD-ROM driver and setup @drive ; cdinit: int 0x2f 0x1500,0 if @bx global drive chr(@cx+asc("A")) else global drive "" endif return cdplay: cdtrack @1 @3 @4 @5 cdcmd 132,@0,@2*75 cdcheck @0,cdplay return ; ; CDPLAYTO TRACK MINUTES SECONDS FRAMES TRACK MINUTES SECONDS FRAMES ; ; cdplayto: cdtrack @1 @2 @3 @4 local begin @0 cdtrack @5 @6 @7 @8 local end @0 cdcmd 132,@begin,@end-@begin cdcheck @0,cdplayto return ; ; CDSTOP ; ; Stop playing immediately ; cdstop: cdcmd 133,0,0 cdcheck @0,cdstop return ; ; CDRESUME ; ; Resume playing from where we issued a CDSTOP ; cdresume: cdcmd 136,0,0 cdcheck @0,cdresume return ; ; CDSEEK TRACK {MINUTES SECONDS FRAMES} ; ; Seek the CD player head to a track to minimize play startup time. ; Parameters are the same as CDPLAY. ; cdseek: cdtrack @1 @2 @3 @4 cdcmd 131,@0,0 cdcheck @0,cdseek return ; ; CDEJECT ; ; Open the CD drive's tray/door ; cdeject: local buf ofs("1") local bseg seg(@buf); poke @bseg @buf 0 ;Eject Disk cdcmd 12,@buf|(@bseg<<16),1 ;WRITE IOCTL Output cdcheck @0,cdeject return ; ; CDCLOSE ; ; Close the CD drive's tray/door ; cdclose: local buf ofs("1") local bseg seg(@buf); poke @bseg @buf 5 ;Close Tray cdcmd 12,@buf|(@bseg<<16),1 ;WRITE IOCTL Output cdcheck @0,cdclose return ; ; CDSTATUS ; ; Return CD Drive status and setup global variables @first and @last ; cdstatus: local buf ofs("123456") local bseg seg(@buf); poke @bseg @buf 10 ;Audio Disk Info cdcmd 3,@buf|(@bseg<<16),6 ;READ IOCTL Input cdcheck @0,cdstatus global first peek(@bseg,@buf+1)+0 global last peek(@bseg,@buf+2)+0 poke @bseg @buf 6 ;Device status cdcmd 3,@buf|(@bseg<<16),5 ;READ IOCTL Input cdcheck @0,cdstatus return peekl(@bseg,@buf+1) ; ; CDTRACK TRACK MINUTES SECONDS FRAMES ; ; Return the absolute sector number of a track ; cdtrack: local buf ofs("1234567") local bseg seg(@buf); poke @bseg @buf 11 ;Get Audio Track Info poke @bseg @buf+1 @1 ;track number cdcmd 3,@buf|(@bseg<<16),7 ;READ IOCTL Input cdcheck @0,cdtrack return peekl(@bseg,@buf+2)+(@2*60+@3)*75+@4 ;return track address cdcmd: local req ofs("12345678901234567890123456") local rseg seg(@req) poke @rseg @req 13 ;param length poke @rseg @req+1 0 ;subunit poke @rseg @req+2 @1 ;command code pokew @rseg @req+3 0 ;status pokel @rseg @req+5 0 0 ;reserved poke @rseg @req+13 1 ;address mode pokel @rseg @req+14 @2 ;begin pokel @rseg @req+18 @3 ;length pokel @rseg @req+22 0 ;reserved int 0x2f 0x1510,@req,asc(@drive)-asc("A"),,,,,seg(@req) if peek(@rseg,@req+4)&0x80 databegin "Unknown Error" "Write-protect violation" "Unknown unit" "Drive not Ready" "Unknown command" "CRC error" "Bad drive request structure length" "Seek Error" "Unknown media" "Sector not found" "Printer out of paper" "Write Fault" "Read Fault" "General failure" "Reserved 1" "Reserved 2" "Invalid disk change" dataend if peek(@rseg,@req+3)<16 dataskip peek(@rseg,@req+3)+1 endif return @ else return "" endif cdcheck: if @1!="" clearscr 0 fload ibm8 1 color 255 set center on text 0 200 @2$": "$@1 text 0 180 "Press any key to exit" set center off ffree 1 waitkey exit endif return prtstatus: if @1&1 text "Door Open"$chr(10) else text "Door Closed"$chr(10) endif if @1&2 text "Door unlocked"$chr(10) else text "Door locked"$chr(10) endif if @1&4 text "Supports cooked and raw reading"$chr(10) else text "Supports only cooked reading"$chr(10) endif if @1&8 text "Read/write"$chr(10) else text "Read only"$chr(10) endif if @1&16 text "Data read and plays audio/video tracks"$chr(10) else text "Data read only"$chr(10) endif if @1&32 text "Supports ISO-9660 interleaving using interleave size and skip factor"$chr(10) else text "No interleaving"$chr(10) endif if @1&128 text "Supports prefetching requests"$chr(10) else text "No Prefetching"$chr(10) endif if @1&256 text "Supports audio channel manipulation"$chr(10) else text "No audio channel manipulation"$chr(10) endif if @1&512 text "Supports HSG and Red Book addressing modes"$chr(10) else text "Supports HSG addressing mode"$chr(10) endif if @1&2048 text "No disc is present in the drive"$chr(10) else text "Disc is present in the drive"$chr(10) endif return